const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let initNumber;
rl.on("line", (line)=>{
    if(initNumber === undefined) {
        initNumber = BigInt(line.trim())
        console.log(getResult(initNumber))

        // clear
        initNumber = undefined
    }

})

function getResult(initNumber) {
    let arr = []
    // 转二进制
    let str = initNumber.toString(2)
    // 倒序遍历
    for (let i = str.length - 1; i >= 0 ; i-= 7) {
        let start = i - 6 < 0 ? 0 : i - 6
        let startChar = start >0 ? "1" : "0"
        let newStr = startChar + str.slice(start, i + 1)
        arr.push(parseInt(newStr, 2).toString(16).padStart(2, "0"))
    }

    //组装结果
    return arr.join("")
}